<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
	String path = request.getContextPath();
%>
<head>
<link rel="stylesheet" type="text/css"
	href="<%=path%>/script/easyUI-1.4/themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css"
	href="<%=path%>/script/easyUI-1.4/themes/icon.css">
<script type="text/javascript"
	src="<%=path%>/script/easyUI-1.4/jquery-3.2.1.min.js"></script>
<script type="text/javascript"
	src="<%=path%>/script/easyUI-1.4/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="<%=path%>/script/easyUI-1.4/locale/easyui-lang-zh_CN.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	$(function(){
	
		$("#resetBtn").bind("click", function() {
			$('#form').form('clear');
		});
		
		
  $("#uptBtn").bind('click',function(){
			  
				 
				    $.ajax({
			            //几个参数需要注意一下
			                type: "POST",//方法类型
			                dataType: "json",//预期服务器返回的数据类型
			                url: "<%=path%>/userAction/saveupt?type=admin&id=${user.id}",
			                data: $('#form').serialize(),
			                success: function (result) {
			                	
			                	if(result.errMsg != null){
			                		$.messager.alert('警告',result.errMsg); 
			                	}else{
			                		$.messager.confirm('提示',result.msg,function(r){    
			                	    	window.location.href="<%=path%>/views/admin/main.jsp";    
			                	}); 
			                	}
			                	
			                	 
			                	
			                },
			                error : function() {
			                    alert("系统异常！");
			                }
			            });
			  
      });
		
	})
	
	
</script>

</head>
<body class="easyui-layout" >
	<div  style="width:350px;margin-top: 50px;margin-left: 550px;">
		<form id="form" method="post" class="easyui-form">
			<div>
				<label>用&nbsp;&nbsp;户&nbsp;&nbsp;名:</label> <input class="easyui-textbox" type="text"
					name="username"  value="${user.username}"/>
			</div>
			
			<div style="margin-top: 10px;">
				<label>真实姓名:</label> <input class="easyui-textbox" type="text"
					name="truename"  value="${userInfo.truename}"/>
			</div>
			
			<div style="margin-top: 10px;">
				<label>密码:</label> <input class="easyui-textbox" type="text"
					name="password"  value="${user.password}"/>
			</div>
			
				<div style="margin-top: 10px;">
							<label>邮箱:</label> <input  type="text" name="email" value="${userInfo.email}"
								class="easyui-textbox" required="required" validType="email"> </input>
			</div>
			
			<div style="margin-top: 10px;">
				<label>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别:</label> <select id="cc" class="easyui-combobox" name="sex"
					style="width: 50px; height: 30px;">
					<option value="男">男</option>
					<option value="女">女</option>
				</select>
			</div>
			<div style="margin-top: 10px;">
				<label>出生日期:</label> <input id="dd" type="text" name="birthday"
					class="easyui-datebox"  value="${userInfo.birthday}" />
			</div>
				<div style="margin-top: 10px;">
				<label>建馆时间:</label> <input id="dd" type="text" name="creatTime"
					class="easyui-textbox" style="width:50px;"  value="${userInfo.creatTime}"> </input>
			</div>
			
			
			<div style="margin-top: 10px;">
				<label>个人简介:</label> <input class="easyui-textbox" type="text"
					name="jianjie"  value="${userInfo.jianjie}"/>
			</div>
			
			<div id="btn" style="margin-top: 20px;">
				<a id="uptBtn" class="easyui-linkbutton"
					data-options="iconCls:'icon-ok'" style="width: 30%; height: 32px">修改</a>
			</div>
		</form>
	</div>
</body>
</html>